<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<title>LAnimationTimeline</title>
	<script type="text/javascript" src="../../lufylegend-1.8.12.simple.js"></script>
	<script type="text/javascript" src="../../lib/lufylegend.ui-0.8.0.min.js"></script>
</head>
<body>
<div id="legend"></div>
<script type="text/javascript">
init(20,"legend",800,450,main);
var imgData = [
	{name:"player",path:"hero.png"}
];
var imglist;
var backLayer,hero;
function main(){
	LLoadManage.load(imgData,null,gameInit);
}
function gameInit(result){
	imglist = result;
	backLayer = new LSprite();
	addChild(backLayer);
	var list = LGlobal.divideCoordinate(560,736,8,8);
	var data = new LBitmapData(imglist["player"],0,0,70,92);
	hero = new LAnimationTimeline(data,list);
	hero.speed = 3;
	hero.setLabel("down",0,0);
	hero.setLabel("left",1,0);
	hero.setLabel("right",2,0);
	hero.setLabel("up",3,0);
	hero.setLabel("left_down",4,0);
	hero.setLabel("right_down",5,0);
	hero.setLabel("left_up",6,0);
	hero.setLabel("right_up",7,0);
	backLayer.addChild(hero);

	var comAction = new LComboBox(15);
	comAction.x = 100;
	comAction.y= 10;
	comAction.setChild({label:"down",value:"down"});
	comAction.setChild({label:"left",value:"left"});
	comAction.setChild({label:"right",value:"right"});
	comAction.setChild({label:"up",value:"up"});
	comAction.setChild({label:"left_down",value:"left_down"});
	comAction.setChild({label:"right_down",value:"right_down"});
	comAction.setChild({label:"left_up",value:"left_up"});
	comAction.setChild({label:"right_up",value:"right_up"});
	backLayer.addChild(comAction);
	comAction.addEventListener(LComboBox.ON_CHANGE,function(event){
		hero.gotoAndPlay(event.target.value);
	});

	var comSpeed = new LComboBox(15);
	comSpeed.x = 100;
	comSpeed.y = 100;
	comSpeed.setChild({label:"speed=0",value:0});
	comSpeed.setChild({label:"speed=1",value:1});
	comSpeed.setChild({label:"speed=2",value:2});
	comSpeed.setChild({label:"speed=3",value:3});
	comSpeed.setChild({label:"speed=4",value:4});
	comSpeed.setChild({label:"speed=5",value:5});
	comSpeed.setChild({label:"speed=6",value:6});
	backLayer.addChild(comSpeed);
	comSpeed.setValue(3);
	comSpeed.addEventListener(LComboBox.ON_CHANGE,function(event){
		hero.speed = event.target.value;
	});
}
</script>
</body>
</html>
